/**
 * 
 */
package org.shanktech.tshare.binlogsync.facotry;

import org.shanktech.tshare.binlogsync.process.TableTransfer;
import org.shanktech.tshare.binlogsync.util.SqlUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TableTransferFactory {

  private static final Logger LOGGER = LoggerFactory.getLogger(TableParserFactory.class);
  
  public static TableTransfer getInstance(String tableName) {
    TableTransfer transfer = null;
    try {
      return (TableTransfer) Class.forName("org.shanktech.tshare.binlogsync.process.transfer."
          + SqlUtil.tableNameToClassName(tableName) + "Transfer").newInstance();
    } catch (Exception e) {
      LOGGER.error("TableTransferFactory get instance exception! tablename = {} ", tableName, e);
    }
    return transfer;
  }
}
